
export default{
    computed: {
        // 表格中列字段
        columns () {
            return [
                {
                    key: 'sf_code',
                    title: {
                        'zh-CN': '人员编码',
                        'en-US': 'sf_code'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'sf_name',
                    title: {
                        'zh-CN': '人员姓名',
                        'en-US': 'sf_name'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'idType',
                    title: {
                        'zh-CN': '证件类型',
                        'en-US': 'id type'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'sf_idNumber',
                    title: {
                        'zh-CN': '证件号码',
                        'en-US': 'id number'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'majorCode',
                    title: {
                        'zh-CN': '主岗名称',
                        'en-US': 'majorCode'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true,
                    render: (h, params) => {
                        return h('div', {}, this.getOptionValue(this.jobOptions, params.row.majorCode))
                    },
                },
                {
                    key: 'jobCode',
                    title: {
                        'zh-CN': '所属岗位',
                        'en-US': 'jobCode'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true,
                    render: (h, params) => {
                        return h('div', {}, this.getOptionValue(this.jobOptions, params.row.jobCode))
                    },
                },
                {
                    key: 'status',
                    title: {
                        'zh-CN': '状态',
                        'en-US': 'status'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    show: true,
                    config: { type: 'select', options: this.statusOptions, disabled: true },
                    render: (h, params) => {
                      return h("div", {}, this.getOptionValue(this.statusOptions, params.row.status));
                    },
                },
                {
                    key: 'age',
                    title: {
                        'zh-CN': '年龄',
                        'en-US': 'age'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    show: true
                },
                {
                    key: 'gender',
                    title: {
                        'zh-CN': '性别',
                        'en-US': 'gender'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    show: true,
                    config: { type: 'select', options: this.genderOptions, disabled: true },
                    render: (h, params) => {
                      return h("div", {}, this.getOptionValue(this.genderOptions, params.row.gender));
                    },
                },
                {
                    key: 'teamName',
                    title: {
                        'zh-CN': '班组',
                        'en-US': 'team name'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true,
                    render: (h, params) => {
                      let teamName = this.teamClassObject.getOtherFatherById(params.row.id)['sf_name']
                      return h("div", {}, teamName);
                    },
                },
                {
                    key: 'deptName',
                    title: {
                        'zh-CN': '所属部门',
                        'en-US': 'deptName'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true,
                    render: (h, params) => {
                      let deptName = this.deptClassObject.getOtherFatherById(params.row.id)['sf_name']
                      return h("div", {}, deptName);
                    },
                },
                {
                    key: 'positionName',
                    title: {
                        'zh-CN': '职级名称',
                        'en-US': 'positionName'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true, 
                    render: (h, params) => {
                      return h("div", {}, this.getOptionValue(this.positionOptions, params.row.positionName));
                    },
                },
                {
                    key: 'natural',
                    title: {
                        'zh-CN': '资质',
                        'en-US': 'natural'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'field',
                    title: {
                        'zh-CN': '专业',
                        'en-US': 'field'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'email',
                    title: {
                        'zh-CN': '电子邮件',
                        'en-US': 'email'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'phone',
                    title: {
                        'zh-CN': '手机号码',
                        'en-US': 'phone'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'startworkdate',
                    title: {
                        'zh-CN': '入职日期',
                        'en-US': 'startworkdate'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'education',
                    title: {
                        'zh-CN': '学历',
                        'en-US': 'education'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true,
                    config: { type: 'select', options: this.educationOptions, disabled: true },
                    render: (h, params) => {
                      return h("div", {}, this.getOptionValue(this.educationOptions, params.row.education));
                    },
                },
                {
                    key: 'directLeaderName',
                    title: {
                        'zh-CN': '直属领导姓名',
                        'en-US': 'directLeaderName'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'acrossLeaderName',
                    title: {
                        'zh-CN': '隔级领导姓名',
                        'en-US': 'acrossLeaderName'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'isSafetyCertificate',
                    title: {
                        'zh-CN': '是否具备安全资格证',
                        'en-US': 'isSafetyCertificate'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'safeStartTime',
                    title: {
                        'zh-CN': '安全资格证开始时间',
                        'en-US': 'safeStartTime'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'safeValidity',
                    title: {
                        'zh-CN': '安全资格证有效期',
                        'en-US': 'safeValidity'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'isSpecialCertificate',
                    title: {
                        'zh-CN': '是否具备特种作业资格证',
                        'en-US': 'isSpecialCertificate'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'SpecialStartTime',
                    title: {
                        'zh-CN': '特种作业证开始时间',
                        'en-US': 'SpecialStartTime'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'specialValidity',
                    title: {
                        'zh-CN': '特种作业证有效期',
                        'en-US': 'specialValidity'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'remark',
                    title: {
                        'zh-CN': '备注',
                        'en-US': 'remark'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    show: true
                },
                {
                    key: 'createdBy',
                    title: {
                        'zh-CN': '创建人账号',
                        'en-US': 'created by'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'createTime',
                    title: {
                        'zh-CN': '创建时间',
                        'en-US': 'create time'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'updatedBy',
                    title: {
                        'zh-CN': '修改人账号',
                        'en-US': 'updated by'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                },
                {
                    key: 'updateTime',
                    title: {
                        'zh-CN': '修改时间',
                        'en-US': 'update time'
                    }[this.G_Locale],
                    minWidth: 200,
                    align: 'center',
                    show: true
                }
            ];
        },
        // form中列字段
        formColumns () {
            return [
                {
                    key: 'sf_code',
                    title: {
                        'zh-CN': '人员编码',
                        'en-US': 'sf_code'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'sf_name',
                    title: {
                        'zh-CN': '人员姓名',
                        'en-US': 'sf_name'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'idType',
                    title: {
                        'zh-CN': '证件类型',
                        'en-US': 'id type'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'sf_idNumber',
                    title: {
                        'zh-CN': '证件号码',
                        'en-US': 'id number'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'status',
                    title: {
                        'zh-CN': '状态',
                        'en-US': 'status'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    config: { type: 'radio', options: this.statusOptions }
                },
                {
                    key: 'majorCode',
                    title: {
                        'zh-CN': '主岗名称',
                        'en-US': 'majorCode'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'select', options: this.jobOptions }
                },
                {
                    key: 'jobCode',
                    title: {
                        'zh-CN': '所属岗位名称',
                        'en-US': 'jobCode'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'select', options: this.jobOptions }
                },
                {
                    key: 'age',
                    title: {
                        'zh-CN': '年龄',
                        'en-US': 'age'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'gender',
                    title: {
                        'zh-CN': '性别',
                        'en-US': 'gender'
                    }[this.G_Locale],
                    minWidth: 70,
                    align: 'center',
                    config: { type: 'radio', options: this.genderOptions }
                },
                {
                    key: 'positionName',
                    title: {
                        'zh-CN': '职级名称',
                        'en-US': 'position name'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'select', options: this.positionOptions }
                },
                {
                    key: 'natural',
                    title: {
                        'zh-CN': '资质',
                        'en-US': 'natural'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'field',
                    title: {
                        'zh-CN': '专业',
                        'en-US': 'field'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'email',
                    title: {
                        'zh-CN': '电子邮件',
                        'en-US': 'email'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'text' }
                },
                {
                    key: 'phone',
                    title: {
                        'zh-CN': '手机号码',
                        'en-US': 'phone'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'number' }
                },
                {
                    key: 'startworkdate',
                    title: {
                        'zh-CN': '入职日期',
                        'en-US': 'startworkdate'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'date' }
                },
                {
                    key: 'education',
                    title: {
                        'zh-CN': '学历',
                        'en-US': 'education'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'select', options: this.educationOptions }
                },
                {
                    key: 'directLeaderName',
                    title: {
                        'zh-CN': '直属领导',
                        'en-US': 'directLeaderName'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'link', link: this.selectDirectLeader }
                },
                {
                    key: 'acrossLeaderName',
                    title: {
                        'zh-CN': '隔级领导',
                        'en-US': 'acrossLeaderName'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'link', link: this.selectAccessLeader }
                },
                {
                    key: 'isSafetyCertificate',
                    title: {
                        'zh-CN': '是否具备安全资格证',
                        'en-US': 'isSafetyCertificate'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'radio', options: [{ label: '是', value: 'yes' }, { label: '否', value: 'no' }] }
                },
                {
                    key: 'safeStartTime',
                    title: {
                        'zh-CN': '安全资格证开始时间',
                        'en-US': 'safeStartTime'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'date' }
                },
                {
                    key: 'safeValidity',
                    title: {
                        'zh-CN': '安全资格证有效期',
                        'en-US': 'safeValidity'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'number' }
                },
                {
                    key: 'isSpecialCertificate',
                    title: {
                        'zh-CN': '是否具备特种作业资格证',
                        'en-US': 'isSpecialCertificate'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'radio', options: [{ label: '是', value: 'yes' }, { label: '否', value: 'no' }] }
                },
                {
                    key: 'SpecialStartTime',
                    title: {
                        'zh-CN': '特种作业证开始时间',
                        'en-US': 'SpecialStartTime'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'date' }
                },
                {
                    key: 'specialValidity',
                    title: {
                        'zh-CN': '特种作业证有效期',
                        'en-US': 'specialValidity'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'number' }
                },
                {
                    key: 'remark',
                    title: {
                        'zh-CN': '备注',
                        'en-US': 'remark'
                    }[this.G_Locale],
                    minWidth: 100,
                    align: 'center',
                    config: { type: 'textarea' }
                }
            ];
        },
        queryFormItem () {
            return [
                {
                    key: 'sf_code',
                    title: {
                        'zh-CN': '人员编码',
                        'en-US': 'sf_code'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                },
                {
                    key: 'sf_name',
                    title: {
                        'zh-CN': '人员姓名',
                        'en-US': 'sf_name'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                },
                {
                    key: 'sf_idNumber',
                    title: {
                        'zh-CN': '证件号码',
                        'en-US': 'id number'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                }
            ];
        },
        collapseFormItem () {
            return [
                {
                    key: 'sf_code',
                    title: {
                        'zh-CN': '人员编码',
                        'en-US': 'sf_code'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                },
                {
                    key: 'sf_name',
                    title: {
                        'zh-CN': '人员姓名',
                        'en-US': 'sf_name'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                },
                {
                    key: 'sf_idNumber',
                    title: {
                        'zh-CN': '证件号码',
                        'en-US': 'id number'
                    }[this.G_Locale],
                    config: {
                        type: 'text'
                    }
                }
            ];
        },
        lang () {
            return {
                'en-US': {
                    cancel: 'cancel',
                    confirmDelete: 'confirm delete?'
                },
                'zh-CN': {
                    cancel: '取消',
                    confirmDelete: '确认删除？'
                }
            }[this.G_Locale]
        }
    },
}